<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <body>

        <ui:composition>

            <div id="post">

                <h3>Alunos da Lista: #{ListaController.listaAux.titulo}</h3>

                <div id="stylized" class="myform">


                    <!--                    <p:pickList value="{ListaAlunoController.alunos}"  
                                                    var="aluno" iconOnly="true"  
                                                    itemLabel="{aluno.nome}"  
                                                    itemValue="{aluno}" converter="AlunoConverter" >  
                                            <f:facet name="sourceCaption">Não Aplicar</f:facet>  
                                            <f:facet name="targetCaption">Aplicar</f:facet>  
                                        </p:pickList> -->

                    <h:panelGrid columns="3" >  

                        <p:dataTable id="tb1" value="#{ListaAlunoController.PAlunos}" var="alunoTemp" >
                            <f:facet name="header">  
                                Não Aplicar
                            </f:facet>  
                            <p:column sortBy="#{alunoTemp.nome}">
                                <f:facet name="header">
                                    <h:outputText value="Nome" />
                                </f:facet>
                                <h:outputText value="#{alunoTemp.nome}" />
                            </p:column>
                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="Painel" />
                                </f:facet>
                                <p:commandButton actionListener="#{ListaAlunoController.addAluno}" title="Para Lista" update="tb1,tb2" ajax="false" image="ui-icon-arrowthick-1-e" />

                            </p:column>
                        </p:dataTable>

                        
                        
                        <h:panelGrid columns="1">
                            <p:commandButton action="#{ListaAlunoController.addAllAlunos}" title="Aplicar para todos" image="ui-icon-arrowthickstop-1-e" ajax="false" />
                            <p:commandButton action="#{ListaAlunoController.removerAllAlunos}" title="Remover para todos" image="ui-icon-arrowthickstop-1-w" ajax="false" />
                        </h:panelGrid>
                        
                        
                        
                        <p:dataTable id="tb2" value="#{ListaAlunoController.PAlunos2}" var="alunoTemp2">

                            <f:facet name="header">  
                                Aplicar
                            </f:facet>  
                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="Painel" />
                                </f:facet>
                                <p:commandButton actionListener="#{ListaAlunoController.removeAluno}" title="Retirar da Lista" update="tb1,tb2" image="ui-icon-arrowthick-1-w" ajax="false" />
                            </p:column>
                            <p:column sortBy="#{alunoTemp2.nome}">
                                <f:facet name="header">
                                    <h:outputText value="Nome" />
                                </f:facet>
                                <h:outputText value="#{alunoTemp2.nome}" />
                            </p:column>

                        </p:dataTable>
                    </h:panelGrid>


                    <!--                        <h:commandButton styleClass="button" onclick="dlgQuestao.show();" type="button"  value="Categoria" />-->
                    <h:commandButton styleClass="button" action="#{ListaAlunoController.persiste}" value="Salvar" id="salvar" />
<!--                    <p:commandButton styleClass="button" action="{ListaAlunoController.persiste}" value="Salvar" id="salvar2" />-->
<!--                    <h:commandButton styleClass="button" type="reset" value="Limpar" id="limpar" />-->


                    <!--
                                            <p:dialog header="Categoria" widgetVar="dlgQuestao" modal="true" width="300" height="400">
                                                <h:outputText>Categorias</h:outputText>
                                                <br />
                    
                                                <h:commandButton styleClass="button" action="{QuestaoController.addItem}" value="Incluir" />
                                                <h:commandButton styleClass="button" type="reset" value="Limpar" />
                    
                    
                                            </p:dialog>-->



                </div>
            </div>
        </ui:composition>

    </body>
</html>
